package com.garen.sys.entity;

import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;
import com.garen.orm.annotation.Formula;


@Table(name="fire_user")
public class FireUser {
	

	public static String DEFAULT_MM = "e48er96gjo32l9f4ke8b19bilg6io0h0";
	
	@Formula(name="user_org_name",value="select tt.org_short_name "
			+ " from fire_org tt where tt.org_id = t.user_org_id")
	private String userOrgName;
	
	@Formula(name="user_role_name",value="select tt.role_name "
			+ " from fire_role tt where tt.role_id= t.user_role_id")
	private String userRoleName;
	
	//职务
	@Formula(name="post_name",value="select tt.code_name "
			+ " from fire_code tt where tt.code_value= t.user_post and tt.code_type = '4'")
	private String postName;
	
	//警衔
	@Formula(name="police_rank_name",value="select tt.code_name "
			+ " from fire_code tt where tt.code_value= t.user_police_rank and tt.code_type = '5'")
	private String policeRankName;
		
	private Integer dutyId;
	
	//年齡
	private Integer fireAge;
	
	/**
	*密码
	*/
	@Column(name = "user_password")
	@JSONField(serialize=false)
	private String userPassword;

	/**
	*主键
	*/
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "user_id",nullable=false)
	private Integer userId;

	/**
	*是否现役:1-现役,2-合同制
	*/
	@Column(name = "user_type")
	private String userType;

	/**
	*状态 0-停用 1-正常
	*/
	@Column(name = "user_status")
	private String userStatus;

	/**
	*最后登录时间
	*/
	@Column(name = "last_login_time")
	@com.alibaba.fastjson.annotation.JSONField(format="yyyy-MM-dd")
	private java.util.Date lastLoginTime;

	/**
	*警衔
	*/
	@Column(name = "user_police_rank")
	private String userPoliceRank;

	/**
	*备注
	*/
	@Column(name = "remark")
	private String remark;

	/**
	*登录名
	*/
	@Column(name = "user_login_name")
	private String userLoginName;

	/**
	*姓名
	*/
	@Column(name = "user_name",nullable=false)
	private String userName;

	/**
	*部门ID
	*/
	@Column(name = "user_org_id")
	private Integer userOrgId;

	/**
	*身份证明号码
	*/
	@Column(name = "user_sfzmhm")
	private String userSfzmhm;

	/**
	*职务
	*/
	@Column(name = "user_post")
	private String userPost;

	/**
	*角色ID
	*/
	@Column(name = "user_role_id",nullable=false)
	private Integer userRoleId;

	/**
	*生日
	*/
	@Column(name = "user_birthday")
	@com.alibaba.fastjson.annotation.JSONField(format="yyyy-MM-dd")
	private java.util.Date userBirthday;

	/**
	*创建时间
	*/
	@Column(name = "create_date",nullable=false)
	@com.alibaba.fastjson.annotation.JSONField(format="yyyy-MM-dd")
	private java.util.Date createDate;



	public String getUserPassword() {
		return userPassword;
	}

	public void setUserPassword(String userPassword) {
		this.userPassword=userPassword;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId=userId;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType=userType;
	}

	public String getUserStatus() {
		return userStatus;
	}

	public String getStatusName() {
		if("0".equals(userStatus)) return "停用";
		else if("1".equals(userStatus)) return "正常";
		return null;
	}
	
	public void setUserStatus(String userStatus) {
		this.userStatus=userStatus;
	}

	public java.util.Date getLastLoginTime() {
		return lastLoginTime;
	}

	public void setLastLoginTime(java.util.Date lastLoginTime) {
		this.lastLoginTime=lastLoginTime;
	}

	public String getUserPoliceRank() {
		return userPoliceRank;
	}

	public void setUserPoliceRank(String userPoliceRank) {
		this.userPoliceRank=userPoliceRank;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark=remark;
	}

	public String getUserLoginName() {
		return userLoginName;
	}

	public void setUserLoginName(String userLoginName) {
		this.userLoginName=userLoginName;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName=userName;
	}

	public Integer getUserOrgId() {
		return userOrgId;
	}

	public void setUserOrgId(Integer userOrgId) {
		this.userOrgId=userOrgId;
	}

	public String getUserSfzmhm() {
		return userSfzmhm;
	}

	public void setUserSfzmhm(String userSfzmhm) {
		this.userSfzmhm=userSfzmhm;
	}

	public String getUserPost() {
		return userPost;
	}

	public void setUserPost(String userPost) {
		this.userPost=userPost;
	}

	public Integer getUserRoleId() {
		return userRoleId;
	}

	public void setUserRoleId(Integer userRoleId) {
		this.userRoleId=userRoleId;
	}

	public java.util.Date getUserBirthday() {
		return userBirthday;
	}

	public void setUserBirthday(java.util.Date userBirthday) {
		this.userBirthday=userBirthday;
	}

	public java.util.Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(java.util.Date createDate) {
		this.createDate=createDate;
	}

	public String getUserOrgName() {
		return userOrgName;
	}

	public void setUserOrgName(String userOrgName) {
		this.userOrgName = userOrgName;
	}

	public String getUserRoleName() {
		return userRoleName;
	}

	public void setUserRoleName(String userRoleName) {
		this.userRoleName = userRoleName;
	}

	public String getPostName() {
		return postName;
	}

	public void setPostName(String postName) {
		this.postName = postName;
	}

	public String getPoliceRankName() {
		return policeRankName;
	}

	public void setPoliceRankName(String policeRankName) {
		this.policeRankName = policeRankName;
	}
	
	public Integer getFireAge() {
		return fireAge;
	}

	public void setFireAge(Integer fireAge) {
		this.fireAge = fireAge;
	}

	public Integer getDutyId() {
		return dutyId;
	}

	public void setDutyId(Integer dutyId) {
		this.dutyId = dutyId;
	}

}
